import { createStore } from 'vuex'

export default createStore({
  state: {
    name: 'Leo',
  },
  mutations: {
    updateName(state, val) {
      state.name = val
    }
  },
  actions: {
    setName({commit}, val) {
      commit('updateName', val)
    }
  },
  modules: {
  },
  getters: {
    name: (state) => {
      return state.name
    }
  }
})
